package main

import "fmt"

type contact struct {
	name string
}

func switchOnType(x interface{}) {
	switch x.(type) {
	case int:
		fmt.Println("x is int")
	case string:
		fmt.Println("x is string")
	case contact:
		fmt.Println("x is contact")
	default:
		fmt.Println("unknown")

	}

}

func main() {
	x := 1
	switchOnType(x)
	x1 := "a"
	switchOnType(x1)
	x2 := contact{name: "a"}
	switchOnType(x2)
	x3 := 3.14
	switchOnType(x3)
}
